home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / stdlib / RCS / getenv.man,v < prev    next >
Encoding:
Text File  |  1990-06-27  |  2.1 KB  |  112 lines

  1. head     1.3;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @@;
  7.  
  8.  
  9. 1.3
  10. date     90.06.27.11.18.41;  author shirriff;  state Exp;
  11. branches ;
  12. next     1.2;
  13.  
  14. 1.2
  15. date     89.01.05.18.00.04;  author ouster;  state Exp;
  16. branches ;
  17. next     1.1;
  18.  
  19. 1.1
  20. date     89.01.05.17.18.31;  author ouster;  state Exp;
  21. branches ;
  22. next     ;
  23.  
  24.  
  25. desc
  26. @@
  27.  
  28.  
  29. 1.3
  30. log
  31. @Fixed typo in man page.
  32. @
  33. text
  34. @.\"    @@(#)getenv.3    6.4 (Berkeley) 3/20/87
  35. .\"
  36. .TH GETENV 3 "March 20, 1987"
  37. .AT 3
  38. .SH NAME
  39. getenv, setenv, unsetenv \- manipulate environmental variables
  40. .SH SYNOPSIS
  41. .nf
  42. .B char *getenv(name)
  43. .B char *name;
  44. .PP
  45. .B void setenv(name, value)
  46. .B char *name, *value;
  47. .PP
  48. .B void unsetenv(name)
  49. .B char *name;
  50. .fi
  51. .SH DESCRIPTION
  52. \fIGetenv\fP searches the environment list (see \fIenviron\fP(7))
  53. for a string of the form \fIname\fP\fB=\fP\fIvalue\fP and returns
  54. a pointer to the string \fIvalue\fP if such a string is present,
  55. and 0 (NULL) if it is not.
  56. .PP
  57. \fISetenv\fP searches the environment list as \fIgetenv\fP does; if
  58. the string \fIname\fP is not found, a string of the form
  59. \fIname\fP\fB=\fP\fIvalue\fP is added to the environment.  If it is
  60. found, its value is changed to
  61. \fIvalue\fP.
  62. .PP
  63. \fIUnsetenv\fP removes all occurrences of the string \fIname\fP from
  64. the environment.  There is no library provision for completely removing
  65. the current environment.  It is suggested that the following code be
  66. used to do so.
  67. .PP
  68. .nf
  69.     static char    *envinit[1];
  70.     extern char    **environ;
  71.     environ = envinit;
  72. .fi
  73. .SH SEE ALSO
  74. csh(1), sh(1), execve(2), environ(7)
  75. @
  76.  
  77.  
  78. 1.2
  79. log
  80. @Changed setenv documentation from UNIX form to Sprite form.
  81. @
  82. text
  83. @d13 1
  84. a13 1
  85. .B char *name, value;
  86. d27 1
  87. a27 1
  88. found, and \fIoverwrite\fP is non-zero, its value is changed to
  89. @
  90.  
  91.  
  92. 1.1
  93. log
  94. @Initial revision
  95. @
  96. text
  97. @d12 1
  98. a12 1
  99. .B setenv(name, value, overwrite)
  100. a13 1
  101. .B int overwrite;
  102. d28 1
  103. a28 3
  104. \fIvalue\fP.  \fISetenv\fP returns 0 on success and -1 on failure,
  105. where failure is caused by an inability to allocate space for the
  106. environment.
  107. a39 3
  108. .PP
  109. All of these routines permit, but do not require, a trailing equals
  110. (``='') sign on \fIname\fP or a leading equals sign on \fIvalue\fP.
  111. @
  112.